<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<style type="text/css">
html {
	font-family: sans-serif;
	-ms-text-size-adjust: 100%;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 40px;
}

table {
	border-collapse: collapse;
	border-spacing: 0;
}

td, th {
	padding: 0;
}

.pure-table {
	border-collapse: collapse;
	border-spacing: 0;
	empty-cells: show;
	border: 1px solid #cbcbcb;
}

.pure-table caption {
	color: #000;
	font: italic 85%/1 arial, sans-serif;
	padding: 1em 0;
	text-align: center;
}

.pure-table td, .pure-table th {
	border-left: 1px solid #cbcbcb;
	border-width: 0 0 0 1px;
	font-size: inherit;
	margin: 0;
	overflow: visible;
	padding: .5em 1em;
}

.pure-table thead {
	background-color: #e0e0e0;
	color: #000;
	text-align: left;
	vertical-align: bottom;
}

.pure-table td {
	background-color: transparent;
}

.pure-table-bordered td {
	border-bottom: 1px solid #cbcbcb;
}

.pure-table-bordered tbody>tr:last-child>td {
	border-bottom-width: 0;
}
</style>
</head>
<body>
	<form action="${pageContext.request.contextPath}/QueryOrder" method="post">
		订单编号：<input type="text" name="order_id" /> 用户：<input type="text"
			name="userName" /> 收货人：<input type="text" name="contactman" />
		订单状态:<select name="status">
			<option value="">请选择</option>
			<option value="0">未付款</option>
			<option value="1">已付款</option>
			<option value="2">已发货</option>
			<option value="3">已收货</option>
		</select> <input type="submit" value="查询" />
		<table class="pure-table pure-table-bordered">
			<thead>
				<tr>
					<th>订单编号</th>
					<th>用户</th>
					<th>收货人</th>
					<th>收货人地址</th>
					<th>收货人电话</th>
					<th>订单日期</th>
					<th>发货日期</th>
					<th>收货日期</th>
					<th>总金额</th>
					<th>备注</th>
					<th>状态</th>
					<th>查看详情</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach var="order" items="${orderlist}">
					<tr>
						<td>${order.order_id }</td>
						<td>${order.userName }</td>
						<td>${order.contactman }</td>
						<td>${order.address }</td>
						<td>${order.phone }</td>
						<td>${order.orderDate }</td>
						<td>${order.deliverDate }</td>
						<td>${order.receiveDate }</td>
						<td><fmt:formatNumber type="number" value="${order.orderSum}"
								pattern="0.00" maxFractionDigits="2" /></td>
						<td>${order.note }</td>
						<td><c:choose>
								<c:when test="${order.status eq '0'}">
									未付款
    							</c:when>
								<c:when test="${order.status eq '1'}">
									已付款
    							</c:when>
								<c:when test="${order.status eq '2'}">
									已发货
    							</c:when>
								<c:otherwise>
									已收货
    							</c:otherwise>
							</c:choose></td>
						<td><a href="${pageContext.request.contextPath}/QueryOrderDetial?order_id=${order.order_id}">查看详情</a>
						</td>
						<td><c:choose>
								<c:when test="${order.status eq '0'}">
									<a href="javascript:void(0)">取消订单</a>
								</c:when>
								<c:when test="${order.status eq '1'}">
									<a href="javascript:void(0)">发货</a>
								</c:when>
							</c:choose></td>
					</tr>
				</c:forEach>
			</tbody>
		</table>

	</form>
</body>
</html>